﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Basic.IdGenerator
{
    public static class ServiceCollectionExtension
    {
        public static IServiceCollection InitIdGenerator(this IServiceCollection services, IConfigurationSection section)
        {
            ushort workerId = section.Get<ushort>();
            IdGenerator.SetWorkerId(workerId);
            return services;
        }
    }
}